<?php

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', ['middleware' => 'api'], function ($api) {
    $api->group(['namespace' => 'Project\Admin\Controllers', 'prefix' => 'admin'], function ($api) {
        // 登录
        $api->post('/login', 'Auth\AuthController@login');
        // 管理员
        $api->post('/user/upload', 'User\AdminUserController@upload');
        $api->resource('/user', 'User\AdminUserController');
        
    });

    $api->group(['namespace' => 'Project\Admin\Controllers', 'middleware' => 'admin.auth', 'prefix' => 'admin'], function ($api) {
        // 退出
        $api->post('/logout', 'Auth\AuthController@logout');
        // 获取登录信息 
        $api->get('/auth/me', 'Auth\AuthController@me');
        // 获取菜单
        $api->post('/auth/menu', 'Auth\AuthController@menu');
        // 菜单管理
        $api->resource('/menu', 'MenuController');
        
    });

    $api->group(['namespace' => 'Project\Admin\Controllers', 'prefix' => 'home'], function ($api) {
       
    });
});